<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			var name = '2345'
			
			const obj = {
			    name: 'objName',
			    printName(a, b) {
			        console.log(this.name, a, b);
			    }
			}
			
			const target = {
			    name: 'targetName'
			}
			
			obj.printName('foo', 'bar')    // objName foo bar
			obj.printName.call(target, 'hello', 'world')    // targetName hello world
			
			// obj.printName.call(null, 'Hello', 'World')    // windowName Hello World
			// obj.printName.call(undefined, 'Hello', 'World')    // windowName Hello World
			// obj.printName.call(false, 'Hello', 'World')    // undefined "Hello" "World"
			// obj.printName.call(123, 'Hello', 'World')  // undefined "Hello" "World"
		</script>
	</body>
</html>